package org.flexspeedup.blog.admin.events
{
import flash.events.Event;

import org.flexspeedup.blog.models.MiniPost;

/**
 * Deletes a post from the datastore
 */
public class DeleteSelectedPostEvent extends Event
{
    //--------------------------------------------------------------------------
    //
    //  Class Properties
    //
    //--------------------------------------------------------------------------

    //--------------------------
    // ID
    //--------------------------
    /**
     * Unique id for this event.
     */
    public static const ID:String = "DeletePostEvent";
    
    //--------------------------------------------------------------------------
    //
    // Constructor
    //
    //--------------------------------------------------------------------------

    /**
     * Creates a new instance of the <code>DeletePostEvent</code> event 
     */    
    public function DeleteSelectedPostEvent(deleteConfirmed:Boolean = false)
    {
        super(ID, true, true);
        _deleteConfirmed = deleteConfirmed;
    }

    //--------------------------------------------------------------------------
    //
    //  Properties
    //
    //--------------------------------------------------------------------------

    //----------------------------------
    //  deleteConfirmed
    //----------------------------------

    /**
     *  @private
     */
    private var _deleteConfirmed:Boolean;

    /**
     * True if the user has confirmed deletion
     */
    public function get deleteConfirmed():Boolean
    {
        return _deleteConfirmed;
    }
    
    //--------------------------------------------------------------------------
    //
    //  Overridden Methods - Event
    //
    //--------------------------------------------------------------------------

    /**
     * @inheritdoc flash.events.Event#clone
     */
    override public function clone():Event
    {
        return new DeleteSelectedPostEvent(deleteConfirmed);
    }
}
}